package com.haizhi.bean;

// Generated 2016-8-15 17:44:37 by Hibernate Tools 3.2.2.GA

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Entity: 
 */
@Entity
@Table(name = "tb_user_collection", catalog = "db_lemon3d")
public class TbUserCollection implements java.io.Serializable {

	/** 
	 * �ղ�id.
	 */

	private Integer collectionId;

	/** 
	 * �û�id.
	 */

	private TbUser tbUser;

	/** 
	 * ��Ʒid.
	 */

	private TbProduct tbProduct;

	/** 
	 * �ղ�ʱ��.
	 */

	private Date collectionTime;

	public TbUserCollection() {
	}

	public TbUserCollection(TbUser tbUser, TbProduct tbProduct,
			Date collectionTime) {
		setTbUser(tbUser);
		setTbProduct(tbProduct);
		setCollectionTime(collectionTime);
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "collection_id", unique = true, nullable = false)
	public Integer getCollectionId() {
		return this.collectionId;
	}

	public void setCollectionId(Integer collectionId) {
		this.collectionId = collectionId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "user_id", nullable = false)
	public TbUser getTbUser() {
		return this.tbUser;
	}

	public void setTbUser(TbUser tbUser) {
		this.tbUser = tbUser;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "product_id", nullable = false)
	public TbProduct getTbProduct() {
		return this.tbProduct;
	}

	public void setTbProduct(TbProduct tbProduct) {
		this.tbProduct = tbProduct;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "collection_time", nullable = false, length = 19)
	public Date getCollectionTime() {
		return this.collectionTime;
	}

	public void setCollectionTime(Date collectionTime) {
		this.collectionTime = collectionTime;
	}

}
